package winningPlayerCount;

public class Solution {

    public int winningPlayerCount(int n, int[][] pick) {
        int[][] counts = new int[n][12];
        int res = 0;
        for (int[] ints : pick) {
            int x = ints[0], y = ints[1];
            if (counts[x][11] == 1) {
                continue;
            }
            counts[x][y] += 1;
            if (counts[x][y] > x) {
                counts[x][11] = 1;
                res += 1;
            }
        }
        return res;
    }


}
